<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>llnews-首页</title>
    <link rel="stylesheet" type="text/css" href="__STATIC__/bootstrap/css/bootstrap.css">
    <script src="__STATIC__/jquery-2.js" type="text/javascript" charset="utf-8"  ></script>

    <script src="__STATIC__/bootstrap/js/bootstrap.js" type="text/javascript" charset="utf-8"  ></script>
    <link rel="stylesheet" href="__P__/css/style.css">

</head>
<body>

{include file="public/nav" }






<div class="wrap row">

    {include file="public/left" }




    <div class="newslist col-md-6 col-sm-8">
        <ul class="newsul">



            {if condition="!empty($articlearr)"}
            {volist name="$articlearr" id="art"}
            <li>
                <a href="{:url('news/detail',['ll_aid'=> $art['ll_aid']])}" title="" class="imga">
                    <img src="{$art.ll_pics}" alt="{$art.ll_title}">
                </a>
                <div class="rbox">
                    <div class="rtitle">
                        <a href="{:url('news/detail',['ll_aid'=> $art['ll_aid']])}" title="">{$art.ll_title}</a>
                    </div>
                    <div class="rfooter">
                        <a href="#" title="">{$art.ll_username}</a>*
                        <a href="{:url('news/detail',['ll_aid'=> $art['ll_aid']])}" title="">{$art.commentnum}评论</a>
                        <span>{$art.passtime|timeToFormat=###} </span>
                    </div>
                </div>
            </li>
            {/volist}
            {/if}

            <!--推荐算法-->
            {if condition="!empty($recarticlearr)"}
            {volist name="$recarticlearr" id="art"}
            <li>
                <a href="{:url('news/detail',['ll_aid'=> $art['ll_aid']])}?token={$token}" title="" class="imga">
                    <img src="{$art.ll_pics}" alt="{$art.ll_title}">
                </a>
                <div class="rbox">
                    <div class="rtitle">
                        <a href="{:url('news/detail',['ll_aid'=> $art['ll_aid']])}?token={$token}" title="">{$art.ll_title}</a>
                    </div>
                    <div class="rfooter">
                        <a href="#" title="">{$art.ll_username}</a>*
                        <a href="{:url('news/detail',['ll_aid'=> $art['ll_aid']])}?token={$token}" title="">{$art.commentnum}评论</a>
                        <span>{$art.passtime|timeToFormat=###} </span>
                    </div>
                </div>
            </li>
            {/volist}
            {/if}


                <!-- Indicates a successful or positive action -->
                <button data-page="1" id="fbtn" type="button" style="margin: 30px auto;display: block;width: 100%" class="btn btn-success">点击加载</button>



        </ul>

    </div>


</div>

<script>
    $(document).ready(function(){
        $("#myNav").affix({
            offset: {
                top: 125 ,

            }
        });
    });
    //分页
    $('#fbtn').click(function (e) {
        that = $(this);
        e.preventDefault();
        $.ajax({
            url:"{:url('index/listjson')}?page="+(that.data('page')+1)+"&ll_cid={$ll_cid}",
            type:'get',
            success:function (res) {
                res = eval('('+res+")");
                console.log(res);
                if(res.code==1){
//                    console.log(res.list);
                    var len = res.list.length;
                    for(var i=0;i<len;i++){
                        var li = "<li>\n" +
                            "                <a href=\"/index/news/detail/ll_aid/"+res.list[i].ll_aid+".html\" title=\"\" class=\"imga\">\n" +
                            "                    <img src=\""+res.list[i].ll_pics+"\" alt=\""+res.list[i].ll_title+"\">\n" +
                            "                </a>\n" +
                            "                <div class=\"rbox\">\n" +
                            "                    <div class=\"rtitle\">\n" +
                            "                        <a href=\"/index/news/detail/ll_aid/"+res.list[i].ll_aid+".html\" title=\"\">"+res.list[i].ll_title+"</a>\n" +
                            "                    </div>\n" +
                            "                    <div class=\"rfooter\">\n" +
                            "                        <a href=\"#\" title=\"\">{$art.ll_username}</a>*\n" +
                            "                        <a href=\"/index/news/detail/ll_aid/"+res.list[i].ll_aid+".html\" title=\"\">{$art.commentnum}评论</a>\n" +
                            "                        <span>{$art.passtime|timeToFormat=###} </span>\n" +
                            "                    </div>\n" +
                            "                </div>\n" +
                            "\n" +
                            "            </li>";
                        that.before(li);
                    }
                    alert(that.data('page')+1);
                    that.data('page',that.data('page')+1);
                }

            }
        })
    })
</script>

</body>

</html>